# nico
**Advanced Smoker Syncronisation Protocol**

With nico you syncronize your nicotin-ballance with others.
It's based on the AASP (advanced smoker synchronisation protocol).

To understand stuff you should take about 5 minutes and read
[this](https://www.korrupt.biz/26c3/assp.pdf "Brainfood").

## Getting started

First clone the git repository to your local machine:
```
git clone git@github.com:grindhold/nico.git
```

To build the binaries we use the meson build system
([more information](https://www.mesonbuild.com "Amazing build system!")).

Install meson:
```
sudo apt install meson
```

Install nico dependencies:
```
sudo apt install libglib2.0-0 libjson-glib-1.0-common libgirepository1.0-dev libgtk-3-0 gir1.2-gtk-3.0
```

Create build directory and prepare files:
```
cd nico
mkdir build
meson build
```

Compile:
```
cd build
ninja
```

Now there should be a `clientapp` and a `server` in your `/build` directory.
You can run them by typing `./server`.

Recompiling is easy: `ninja`

## Client and Server

This is kinda short. If you really want to know it, read 
[this](https://www.korrupt.biz/26c3/assp.pdf "Awesome Stuff to read") and take a look at the `servertest.py`.

### Server

The server holds information about all sessions and updates each client.

### Client

The client can `create` smoking sessions, `join` them and `leave` them.
The `join` and `create` request tells the server your resources (tabak, filter, papes, lighter).
